package mybatis.service;

import mybatis.dao.StudentDao;
import mybatis.entity.Student;

public class ModifyServiceImpl implements ModifyService{
    private StudentDao studentDao;

    public StudentDao getStudentDao() {
        return studentDao;
    }

    public void setStudentDao(StudentDao studentDao) {
        this.studentDao = studentDao;
    }

    @Override
    public Integer insertStudent(Student student) {
        return studentDao.insertStudent(student);
    }

    @Override
    public Integer deleteStudent(int id) {
        return studentDao.deleteStudent(id);
    }

    @Override
    public Integer updateStudent(Student student) {
        //test roll back function by txmanager
//        if(1==1) {
//            throw new RuntimeException("RuntimeException");
//        }
        return studentDao.updateStudent(student);
    }
}
